#ifndef _Ray_H_
#define _Ray_H_

#pragma once
#include "LightingRender.h"

class Ray {
public:
	Vector3 origin, dir;

	Ray() {}
	Ray(const Ray & ray) : origin(ray.origin), dir(ray.dir) {}
	Ray(const Vector3 & origin) : origin(origin) {}
	Ray(const Vector3 & origin, const Vector3 & direction) :origin(origin), dir(direction) {}
	~Ray() {}

	inline Vector3 Ray::getPoint(Double t) const {
		return origin + dir * t;
	}

	inline string str() const {
		ostringstream ss;
		ss << "Ray[ori(" << origin.x << "," << origin.y << "," << origin.z << ")";
		ss << ",dir(" << dir.x << "," << dir.y << "," << dir.z << ")]";
		return ss.str();
	}
};

#endif // _Ray_H_